{% extends "base.html" %}
{% block title %}排队列表{% endblock %}
{% block head %}
    {{ super() }}
    <style>
        .headerImg {
            width: 4em;
            height: 4em;
            border-radius: 4em;
        }
    </style>
{% endblock %}
{% block body %}
    <div>
        <div class="weui-well">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <img src="/static/images/doctor.jpg"
                         class="headerImg">
                </div>
                <div class="weui-cell__bd">
                    <p id="QueueName">
                    </p>
                    <p id="CallingRoom">
                    </p>
                    <p id="FloorName">
                    </p>
                </div>
                <div class="cell__hd__ft">
                    <i id="remindBtn" class="iconfont" style="font-size: 25px;display: none">&#xe621;</i>
                </div>
            </div>
        </div>
        <div class="weui-well">
            <div class="current">
                <div>您是第 <span class="font18 font-bold" id="QueueNumber"></span> 位</div>
                <div>排队号<span class="font16 font-bold" id="TeamNumber"></span>
                    <i id="refreshBtn"
                       class="iconfont text-common">&#xe604;</i>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block script %}
    {{ super() }}
    <script type="text/javascript">
        function refreshData() {
            scheduleID = common.getQueryString("scheduleID");
            $.post(navRoot + "/api/baodao/queue", {"scheduleID": scheduleID}, function (data) {
                if (data["code"] == 200) {
                    data = data.data.data;
                    $("#QueueName").text(data["ModalityName"]);
                    $("#CallingRoom").text(data["RoomName"]);
                    $("#FloorName").text(data["FloorName"]);
                    $("#QueueNumber").text(data["OrderNumber"]);
                    $("#TeamNumber").text(data["TeamNumber"]);
                    //$("#NumberOfFront").text(data["OrderNumber"]-1);
                } else {
                    $.alert(data["errmsg"]);
                }

            }, "json")
        }

        $(function () {
            refreshData();
            $("#refreshBtn").click(function () {
                refreshData();
            })
            $("#remindBtn").click(function () {
                $.actions({
                    actions: [{
                        text: "不提醒",
                        onClick: function () {
                            select_type = 3;
                        }
                    },
                        {
                            text: "提前1位",
                            onClick: function () {
                            }
                        },
                        {
                            text: "提前2位",
                            onClick: function () {
                                select_type = 3;
                            }
                        }]
                });
            })
        })
    </script>
{% endblock %}